package decorator.starbuzzNew;

/**
 * @author jacob
 * @Date 2020/12/16 00:34
 */
public class Soy extends CondimentDecorator {

    Beverage beverage;

    public Soy(Beverage beverage) {
        this.beverage = beverage;
    }

    @Override
    public String getDescription() {
        return beverage.getDescription() + ", Size [" + beverage.getSize() + "] Soy";
    }

    @Override
    public double cost() {
        double cost = beverage.cost();
        if (Size.TALL == beverage.getSize()) {
            cost += 0.15;
        } else if (Size.GRANDE == beverage.getSize()){
            cost += 0.25;
        } else if (Size.VENTI == beverage.getSize()){
            cost += 0.35;
        }

        return cost;
    }
}
